<template>
	<view class="big_box">
		<u-navbar title="邀请海报" :autoBack="true">
		</u-navbar>
		<view class="list">
			<view class="pop_box">
				<view class="title">
					您的专属海报
				</view>
				<image :src="poster_url" mode="widthFix" @longpress="handleLongPress"></image>
				<text>长按图片保存</text>
			</view>
		</view>

	</view>
</template>

<script>
import {
	mapGetters
} from "vuex";
import api from '@/api/index.js'
export default {
	data() {
		return {
			is_show: false,
			poster_url: '',
			itemName: ''
		}
	},
	computed: mapGetters(['isLogin', 'uid', 'userInfo']),
	onLoad() {
		this.getPoster()
	},
	methods: {
		//获取海报图
		getPoster() {
			api.getPoster().then(res => {
				if (res.response.statusCode == 200) {
					this.poster_url = res.data.data[0].image
				}
			}).catch(err => {
				console.error(err)
			})
		},
		handleLongPress(){
			uni.setStorageSync('zhitui_id',this.user_info.id)
		}
	}
}
</script>

<style lang="scss" scoped>
@mixin flex-center-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

@mixin flex-center-column {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.big_box {
	padding: 1rem;
}

.list {
	display: flex;
	flex-direction: column;
	width: 100%;
	border-top: 1px solid #f1f1f1;
	margin-top: 2rem;

	.pop_box {
		width: 100%;
		@include flex-center-column;
		padding: 1rem 0;

		.title {
			font-size: 1rem;
		}

		image {
			width: 90%;
			margin: 1rem auto;
		}

		text {
			font-size: .8rem;
			color: #828181;
		}

	}
}
</style>